<?php

/**
 * @author wangbin
 * @email 289807170@qq.com
 * @data 2015-11-26  18:41:50
 */
class ActiveenlistViewModel extends ViewModel {

    var $sql;

    function _initialize() {
        $this->viewFields[] = array(
            '_sql' => 'SELECT
			`a`.`id`,
			`a`.`active_name_id`,
			`a`.`client_log_id`,
			`a`.`sign_status_id`,
			IF(`a`.`sign_status_id`=10101075,1,0) as status,
			`a`.`time`,
			`a`.`u_time`,
			`b`.`title`,
			`b`.`active_type_id`,
			`c`.`name` `active_type`,
			`d`.`account`,
			`d`.`nickname`,
			`d`.`name`,
			`e`.`name` `sign_status`
		FROM
			`jh_active_active_enlist` `a`
		LEFT JOIN `jh_active_active_name` `b` ON `a`.`active_name_id` = b.id
		LEFT JOIN `jh_source_basic_field` `c` ON `b`.`active_type_id` = concat(`c`.`group_id`, `c`.`id`)
		LEFT JOIN `jh_source_client_login` `d` ON `d`.`id` = `a`.`client_log_id`
		LEFT JOIN `jh_source_basic_field` `e` ON `a`.`sign_status_id` = concat(`e`.`group_id`, `e`.`id`)'
        );
        
        parent::_initialize();
    }

}
